package com.lyh.order.control;


import com.lyh.domain.bean.OrderInfo;
import com.lyh.domain.server.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @author liuyuhong
 */
@RestController
@RequestMapping("/order")
public class OrderControl {

    @Autowired
    private OrderService orderService;

    @RequestMapping(value = "/success", method = RequestMethod.POST)
    public void testSuccess(@RequestBody OrderInfo orderInfo){
        orderInfo.setOrderNum(UUID.randomUUID().toString());
        orderService.insertOrder(orderInfo);
    }

    @RequestMapping("/error")
    public void testError(){

    }
}
